/*
 * 百度在线网络技术（北京）有限公司拥有本软件版权2022并保留所有权利。
 * Copyright 2022, Baidu.com,Inc 2:Baidu Online Network Technology (Beijing) Co.,Ltd,
 * All rights reserved.
 */

package com.azdebugit.hash.map.test.othermap.test.list;

public class StudentDTO implements Comparable {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public int compareTo(Object o) {
        StudentDTO sdto = (StudentDTO) o;
        int otherAge = sdto.getAge();
// note: enum-type's comparation depend on types' list order of enum method
// so, if compared property is enum-type ,then its comparationfollow ObjEnum.objType order
        return this.age-otherAge>0?1:-1;
    }
}